package com.example.jn_dxs.Ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Toast;

import com.example.jn_dxs.Base.BaseActivity;
import com.example.jn_dxs.Base.BaseViewModel;
import com.example.jn_dxs.R;
import com.example.jn_dxs.databinding.ActivityChangePassWordActivitysBinding;

public class ChangePassWordActivity extends BaseActivity<BaseViewModel, ActivityChangePassWordActivitysBinding> {


    @Override
    protected int getLayoutId() {
        return R.layout.activity_change_pass_word_activitys;
    }

    @Override
    protected void initEventAndView() {
        binding.MyTopBar.tvBack.setOnClickListener(v -> finish());
        binding.MyTopBar.tvTitle.setText("修改密码");
        binding.MyTopBar.tvRight.setVisibility(View.VISIBLE);
        binding.MyTopBar.tvRight.setText("确定");
        binding.MyTopBar.tvRight.setOnClickListener(v -> {
            if (TextUtils.isEmpty(binding.AccountNumber.getText())){
                Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
                return;
            }
            if (TextUtils.isEmpty(binding.NewPassWord.getText())){
                Toast.makeText(this, "请输入新密码", Toast.LENGTH_SHORT).show();
                return;
            }
            if (TextUtils.isEmpty(binding.NewPassWordAgain.getText())){
                Toast.makeText(this, "请再次输入新密码", Toast.LENGTH_SHORT).show();
                return;
            }
            Toast.makeText(this, "修改成功", Toast.LENGTH_SHORT).show();
        });
    }

    @Override
    public void initClick() {

    }
}
